*************************************
*** Panel Analysis: SOEP *************
*************************************

clear
global OUT "SET_YOUR_OUTPATH"

// this is for data which is later read into R
global OUT2 "SET_YOUR_OUTPATH_FOR_DATAFRAMES"	


***create dummy datasets for regsave

*hybrid models
clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_loginc.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_sat.dta", replace


*bivariate
clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_0.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt_0.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_loginc_0.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_sat_0.dta", replace


*equivalence tests
clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt_e.dta", replace



*lag models
clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_hhinc.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_hhinc_dec_pp_sqrt.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_hhinc_sat.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_loginc.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_incdiff2.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_jobloss.dta", replace

clear
input coef stderr ci_lower ci_upper N _id
. . . . . .
end
save "$OUT2\SOEP\soep_coef_lag_inc_subj_obj.dta", replace




*load data
use "SET_YOUR_INPATH\SOEP\Data\soep_long.dta", clear

xtset pid syear


* remove outliers
replace hhinc=. if hhinc>30000 & hhinc<9999999

*** recode variables

*use hhinc with standardized hhinc
egen zhhinc = std(hhinc)
replace hhinc = zhhinc


// use income deciles from 1-10
rename hhinc_dec10 hhinc_dec10_
clonevar hhinc_dec10 = hhinc_dec 
 
rename hhinc_dec_pp10 hhinc_dec_pp10_
clonevar hhinc_dec_pp10 = hhinc_dec_pp 
 
rename hhinc_dec_pp_sqrt10 hhinc_dec_pp_sqrt10_
clonevar hhinc_dec_pp_sqrt10 = hhinc_dec_pp_sqrt 

// gen loginc
gen loginc = ln(hhinc_pp_sqrt)



*create interaction variables
gen hhincXage = hhinc * age18
gen hhinc__ppXage = hhinc_pp * age18
gen hhinc__pp_sqrtXage = hhinc_pp_sqrt * age18

gen hhinc_decXage = hhinc_dec10 * age18
gen hhinc_dec_ppXage = hhinc_dec_pp10 * age18
gen hhinc_dec_pp_sqrtXage = hhinc_dec_pp_sqrt10 * age18

gen hhinc_satXage = hhinc_sat * age18

gen hhinc_decXage1835 = hhinc_dec10 * age1835
gen hhinc_satXage1835 = hhinc_sat * age1835



* generate income change/jobloss variables

gen incdiff = hhinc_dec-L.hhinc_dec 

recode incdiff (-9/-1=1 "shock")(0/9=0 "no shock")(else=.), gen(incdiff1)
recode incdiff (-9/-2=1 "shock")(-1 0/9=0 "no shock")(else=.), gen(incdiff2)

// jobloss has 9813 cases on 1
gen jobloss = 0
replace jobloss = . if lfst==.
replace jobloss = 1 if lfst==6 & L.lfst==11



*create engagement scales via factor analysis
reg polint10 partyid_str10
gen mysample1 = e(sample)
polychoric polint10 partyid_str10 if mysample1==1

global N = r(sum_w)
matrix r = r(R)
factormat r, n($N) factors(1)
predict f1
sum f1
gen engagement = ((f1 - r(min)) / (r(max)-r(min)))*10
lab var engagement "Political Engagement Scale"



**************************************
***** Analysis ***********************
**************************************

estpost summarize vote polint10 partyid01 vote_prob10 partyid_str10  ///
	hhinc hhinc_pp hhinc_pp_sqrt hhinc_dec10 hhinc_dec_pp10 hhinc_dec_pp_sqrt10 hhinc_sat incdiff2 jobloss female age18 unemployed nlf edu_med edu_high migrant hhinc_decXage hhinc_satXage  ///
	hhinc_dec_ppXage hhinc_dec_pp_sqrtXage
 esttab using "$OUT\Tables\SOEP\summary_stats_soep.rtf", cells("count mean(fmt(3)) sd(fmt(3))  min max") replace



* regressions with age (continuous)

// for coef export
foreach var of varlist vote polint10 partyid01 vote_prob10 partyid_str10  {
	xthybrid `var' hhinc, clusterid(pid) full
	eststo m001_`var'
	regsave W__hhinc B__hhinc using "$OUT2\SOEP\soep_coef_hhinc_0.dta", ci level(95) autoid append
	xthybrid `var' hhinc female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
	eststo m01_`var'
	regsave W__hhinc B__hhinc using "$OUT2\SOEP\soep_coef_hhinc.dta", ci level(95) autoid append
	
	xthybrid `var' loginc, clusterid(pid) full
	eststo m002_`var'
	regsave W__loginc B__loginc using "$OUT2\SOEP\soep_coef_loginc_0.dta", ci level(95) autoid append
	xthybrid `var' loginc female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
	eststo m02_`var'
	regsave W__loginc B__loginc using "$OUT2\SOEP\soep_coef_loginc.dta", ci level(95) autoid append
		
	xthybrid `var' hhinc_dec_pp_sqrt10, clusterid(pid) full
	eststo m03_`var'
	regsave W__hhinc_dec_pp_sqrt10 B__hhinc_dec_pp_sqrt10 using "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt_0.dta", ci level(95) autoid append
	xthybrid `var' hhinc_dec_pp_sqrt10 female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
	eststo m3_`var'
	regsave W__hhinc_dec_pp_sqrt10 B__hhinc_dec_pp_sqrt10 using "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt.dta", ci level(95) autoid append
	
	xthybrid `var' hhinc_sat, clusterid(pid) full
	eststo m04_`var'
	regsave W__hhinc_sat B__hhinc_sat using "$OUT2\SOEP\soep_coef_hhinc_sat_0.dta", ci level(95) autoid append
	xthybrid `var' hhinc_sat female age18 unemployed nlf edu_med edu_high migrant , clusterid(pid) full
	eststo m4_`var'
	regsave W__hhinc_sat B__hhinc_sat using "$OUT2\SOEP\soep_coef_hhinc_sat.dta", ci level(95) autoid append
}


// for equivalence testing
foreach var of varlist  vote polint10 partyid01 vote_prob10 partyid_str10 {
	xtreg `var' hhinc_dec_pp_sqrt10 age18 unemployed nlf edu_med edu_high, fe
	regsave hhinc_dec_pp_sqrt10 using "$OUT2\SOEP\soep_coef_hhinc_dec_pp_sqrt_e.dta", ci level(90) autoid append
}


// interactions
foreach var of varlist vote polint10 partyid01 vote_prob10 partyid_str10  {
	xthybrid `var' hhinc_dec_pp_sqrt10 female age18 unemployed nlf edu_med edu_high migrant hhinc_dec_pp_sqrtXage, clusterid(pid) full
	eststo m7_`var'
}

// two tables	
esttab m3_vote m7_vote m3_polint10 m7_polint10 m3_partyid01 m7_partyid01 m3_vote_prob10 m7_vote_prob10 m3_partyid_str10 m7_partyid_str10 ///
	using "$OUT\Tables\SOEP\hybrid_all_incdec_pp_sqrt.rtf", b(3) se replace
esttab m3_vote m7_vote m3_polint10 m7_polint10 m3_partyid01 m7_partyid01 m3_vote_prob10 m7_vote_prob10 m3_partyid_str10 m7_partyid_str10 ///
	using "$OUT\Tables\SOEP\hybrid_all_incdec_pp_sqrt.tex", b(3) se replace label nonumbers booktabs alignment(D{.}{.}{3}) scalars("N N")	///
	varlabels ///
				(R__sex "Sex" ///
				R__migrant "Migrant" ///
				R__edu_med "Edu: medium" ///
				R__edu_high "Edu: high" ///
				W__edu_med "Edu: medium" ///
				W__edu_high "Edu: high" ///
				B__edu_med "Edu: medium" ///
				B__edu_high "Edu: high" ///
				W__age18 "W: Age" ///
				B__age18 "B: Age" ///
				W__unemployed "W: Unemployed" ///
				B__unemployed "B: Unemployed" ///
				W__nlf "W: Not in Labor Force" ///
				B__nlf "B: Not in Labor Force" ///
				W__hhinc "W: Income" ///
				B__hhinc "B: Income" ///
				W__hhincXage "W: Inc. * Age" ///
				B__hhincXage "B: Inc. * Age" ///
				W__hhinc_pp_sqrt10 "W: Income (dec.)" ///
				B__hhinc_pp_sqrt10 "B: Income (dec.)" ///
				W__hhinc_pp_sqrtXage "W: Inc. (dec.) * Age" ///
				B__hhinc_pp_sqrtXage "B: Inc. (dec.) * Age" ///
				W__hhinc_sat "W: Sat. Income" ///
				B__hhinc_sat "B: Sat. Income" ///
				W__hhinc_satXage "W: Sat. Inc. * Age" ///
				B__hhinc_satXage "B: Sat. Inc. * Age" ///
				_cons "Constant")		




// engagement scale:
xthybrid engagement hhinc_dec_pp_sqrt10 female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
eststo m_engage	
	
esttab m_engage ///
	using "$OUT\Tables\SOEP\hybrid_engage_eqinc.tex", b(3) se replace label nonumbers booktabs alignment(D{.}{.}{3}) scalars("N N")	///
	varlabels ///
				(R__female "Female" ///
				R__migrant "Migrant" ///
				R__edu_med "Edu: medium" ///
				R__edu_high "Edu: high" ///
				W__edu_med "Edu: medium" ///
				W__edu_high "Edu: high" ///
				B__edu_med "Edu: medium" ///
				B__edu_high "Edu: high" ///
				W__age18 "W: Age" ///
				B__age18 "B: Age" ///
				W__unemployed "W: Unemployed" ///
				B__unemployed "B: Unemployed" ///
				W__nlf "W: Not in Labor Force" ///
				B__nlf "B: Not in Labor Force" ///
				W__hhinc_pp_sqrt10 "W: Income (dec.)" ///
				B__hhinc_pp_sqrt10 "B: Income (dec.)" ///
				_cons "Constant")				
				

// use imputed income for comparison
foreach var of varlist vote polint10 partyid01 vote_prob10 partyid_str10 {
	xthybrid `var' eqinc_imp_dec female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
	eststo m_`var'_eqinc_imp	
}
	
esttab m_vote_eqinc_imp m_vote_prob10_eqinc_imp m_polint10_eqinc_imp m_partyid01_eqinc_imp m_partyid_str10_eqinc_imp ///
	using "$OUT\Tables\SOEP\hybrid_all_eqinc_imp.tex", b(3) se replace label nonumbers booktabs alignment(D{.}{.}{3}) scalars("N N")	///
	varlabels ///
				(R__female "Female" ///
				R__migrant "Migrant" ///
				R__edu_med "Edu: medium" ///
				R__edu_high "Edu: high" ///
				W__edu_med "Edu: medium" ///
				W__edu_high "Edu: high" ///
				B__edu_med "Edu: medium" ///
				B__edu_high "Edu: high" ///
				W__age18 "W: Age" ///
				B__age18 "B: Age" ///
				W__unemployed "W: Unemployed" ///
				B__unemployed "B: Unemployed" ///
				W__nlf "W: Not in Labor Force" ///
				B__nlf "B: Not in Labor Force" ///
				W__eqinc_imp_dec "W: Income (dec.)" ///
				B__eqinc_imp_dec "B: Income (dec.)" ///
				_cons "Constant")				
				
				
	
// test: objective income on subjective income
foreach var of varlist hhinc hhinc_dec_pp_sqrt10 incdiff2 {
	xthybrid hhinc_sat `var' female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) full
	eststo inc_so_`var'
}
esttab inc_so_hhinc inc_so_hhinc_dec_pp_sqrt10 inc_so_incdiff2 ///
	using "$OUT\Tables\SOEP\hybrid_all_inc_subj_obj.rtf", b(2) se replace
esttab inc_so_hhinc inc_so_hhinc_dec_pp_sqrt10 inc_so_incdiff2 ///
	using "$OUT\Tables\SOEP\hybrid_all_inc_subj_obj.tex", b(2) se replace booktabs alignment(D{.}{.}{3})
	

	
*logistic model for vote	
xthybrid vote hhinc_dec_pp_sqrt10 female age18 unemployed nlf edu_med edu_high migrant, clusterid(pid) family(binomial) link(logit) full
eststo m5_vote_logit
esttab  m5_vote_logit  ///
	using "$OUT\Tables\SOEP\hybrid_vote_logit.rtf", b(3) se replace
esttab  m5_vote_logit  ///
	using "$OUT\Tables\SOEP\hybrid_vote_logit.tex", b(3) se replace label nonumbers booktabs alignment(D{.}{.}{3}) scalars("N N")	///
	varlabels ///
				(R__sex "Sex" ///
				R__migrant "Migrant" ///
				R__edu_med "Edu: medium" ///
				R__edu_high "Edu: high" ///
				W__edu_med "Edu: medium" ///
				W__edu_high "Edu: high" ///
				B__edu_med "Edu: medium" ///
				B__edu_high "Edu: high" ///
				W__age18 "W: Age" ///
				B__age18 "B: Age" ///
				W__unemployed "W: Unemployed" ///
				B__unemployed "B: Unemployed" ///
				W__nlf "W: Not in Labor Force" ///
				B__nlf "B: Not in Labor Force" ///
				W__hhinc "W: Income" ///
				B__hhinc "B: Income" ///
				W__hhincXage "W: Inc. * Age" ///
				B__hhincXage "B: Inc. * Age" ///
				W__hhinc_pp_sqrt10 "W: Income (dec.)" ///
				B__hhinc_pp_sqrt10 "B: Income (dec.)" ///
				W__hhinc_pp_sqrtXage "W: Inc. (dec.) * Age" ///
				B__hhinc_pp_sqrtXage "B: Inc. (dec.) * Age" ///
				W__hhinc_sat "W: Sat. Income" ///
				B__hhinc_sat "B: Sat. Income" ///
				W__hhinc_satXage "W: Sat. Inc. * Age" ///
				B__hhinc_satXage "B: Sat. Inc. * Age" ///
				_cons "Constant")		
*






*************************
* FE models
*************************

* restriction: variables need to be at least in 4 waves


* FE model
foreach var of varlist polint10 partyid01 partyid_str10 {
	xtreg `var' L(0/3).hhinc F.hhinc age18 unemployed nlf edu_med edu_high, fe
	eststo fe0_`var'_inc
	regsave F.hhinc hhinc L1.hhinc L2.hhinc L3.hhinc using "$OUT2\SOEP\soep_coef_lag_hhinc.dta", ci level(95) autoid append
	xtreg `var' L(0/3).loginc F.loginc age18 unemployed nlf edu_med edu_high, fe
	eststo fe0_`var'_loginc
	regsave F.loginc loginc L1.loginc L2.loginc L3.loginc using "$OUT2\SOEP\soep_coef_lag_loginc.dta", ci level(95) autoid append
	xtreg `var' L(0/3).hhinc_dec_pp_sqrt10 F.hhinc_dec_pp_sqrt10 age18 unemployed nlf edu_med edu_high, fe
	eststo fe_`var'_inc_pp_s
	regsave F.hhinc_dec_pp_sqrt10 hhinc_dec_pp_sqrt10 L1.hhinc_dec_pp_sqrt10 L2.hhinc_dec_pp_sqrt10 L3.hhinc_dec_pp_sqrt10 using "$OUT2\SOEP\soep_coef_lag_hhinc_dec_pp_sqrt.dta", ci level(95) autoid append
	xtreg `var' L(0/3).hhinc_sat F.hhinc_sat age18 unemployed nlf edu_med edu_high, fe
	eststo fe_`var'_inc_sat
	regsave F.hhinc_sat hhinc_sat L1.hhinc_sat L2.hhinc_sat L3.hhinc_sat using "$OUT2\SOEP\soep_coef_lag_hhinc_sat.dta", ci level(95) autoid append
	xtreg `var' L(0/3).incdiff2 F.incdiff2 age18 unemployed nlf edu_med edu_high, fe
	eststo fe_`var'_incdiff2
	regsave F.incdiff2 incdiff2 L1.incdiff2 L2.incdiff2 L3.incdiff2 using "$OUT2\SOEP\soep_coef_lag_incdiff2.dta", ci level(95) autoid append
	xtreg `var' L(0/3).jobloss F.jobloss age18 edu_med edu_high, fe
	eststo fe_`var'_jobloss
	*regsave F.jobloss jobloss L1.jobloss L2.jobloss L3.jobloss using "$OUT2\SOEP\soep_coef_lag_jobloss.dta", ci level(95) autoid append
}


esttab fe_polint10_incdiff2 fe_partyid01_incdiff2 fe_partyid_str10_incdiff2  ///
	using "$OUT\Tables\SOEP\fe_lag_all_incdiff2.rtf", b(3) se replace	
esttab fe_polint10_incdiff2 fe_partyid01_incdiff2 fe_partyid_str10_incdiff2  ///
	using "$OUT\Tables\SOEP\fe_lag_all_incdiff2.tex", b(3) scalars("N N") se replace label nonumbers booktabs alignment(D{.}{.}{3})	///
	varlabels ///
				(edu_med "Edu: medium" ///
				edu_high "Edu: high" ///
				age18 "Age" ///
				unemployed "Unemployed" ///
				nlf "Not in Labor Force" ///
				hhinc "Income\textsubscript{t0}" ///
				L.hhinc "Income\textsubscript{t-1}" ///
				L2.hhinc "Income\textsubscript{t-2}" ///
				L3.hhinc "Income\textsubscript{t-3}" ///
				F.hhinc "Income\textsubscript{t+1}" ///
				hhinc_dec_pp_sqrt10 "Income (dec.)\textsubscript{t0}" ///
				L.hhinc_dec_pp_sqrt10 "Income (dec.)\textsubscript{t-1}" ///
				L2.hhinc_dec_pp_sqrt10 "Income (dec.)\textsubscript{t-2}" ///
				L3.hhinc_dec_pp_sqrt10 "Income (dec.)\textsubscript{t-3}" ///
				F.hhinc_dec_pp_sqrt10 "Income (dec.)\textsubscript{t+1}" ///
				hhinc_sat "Sat. Income\textsubscript{t0}" ///
				L.hhinc_sat "Sat. Income\textsubscript{t-1}" ///
				L2.hhinc_sat "Sat. Income\textsubscript{t-2}" ///
				L3.hhinc_sat "Sat. Income\textsubscript{t-3}" ///
				F.hhinc_sat "Sat. Income\textsubscript{t+1}" ///
				incdiff2 "Inc. Shock\textsubscript{t0}" ///
				L.incdiff2 "Inc. Shock\textsubscript{t-1}" ///
				L2.incdiff2 "Inc. Shock\textsubscript{t-2}" ///
				L3.incdiff2 "Inc. Shock\textsubscript{t-3}" ///
				F.incdiff2 "Inc. Shock\textsubscript{t+1}" ///
				_cons "Constant")
	
esttab fe_polint10_jobloss fe_partyid01_jobloss fe_partyid_str10_jobloss  ///
	using "$OUT\Tables\SOEP\fe_lag_all_jobloss.rtf", b(3) se replace	
esttab fe_polint10_jobloss fe_partyid01_jobloss fe_partyid_str10_jobloss  ///
	using "$OUT\Tables\SOEP\fe_lag_all_jobloss.tex", b(3) scalars("N N") se replace label nonumbers booktabs alignment(D{.}{.}{3})	///
	varlabels ///
				(edu_med "Edu: medium" ///
				edu_high "Edu: high" ///
				age18 "Age" ///
				jobloss "Job Loss\textsubscript{t0}" ///
				L.jobloss "Job Loss\textsubscript{t-1}" ///
				L2.jobloss "Job Loss\textsubscript{t-2}" ///
				L3.jobloss "Job Loss\textsubscript{t-3}" ///
				F.jobloss "Job Loss\textsubscript{t+1}" ///
				_cons "Constant")
	

	
*Cross-check: objective income on subjective income 
foreach var of varlist hhinc hhinc_dec_pp_sqrt10 incdiff2 {
	xtreg hhinc_sat L(0/3).`var' F1.`var' age18 unemployed nlf edu_med edu_high, fe
	eststo m_`var'
	*regsave F1.`var' `var' L1.`var' L2.`var' L3.`var' using "$OUT2\SOEP\soep_coef_lag_inc_subj_obj_`var'.dta", ci level(95) autoid append
}
esttab m_hhinc m_hhinc_dec_pp_sqrt10 m_incdiff2   ///
	using "$OUT\Tables\SOEP\fe_lag_all_inc_subj_obj.rtf", b(2) se replace		
esttab m_hhinc m_hhinc_dec_pp_sqrt10 m_incdiff2   ///
	using "$OUT\Tables\SOEP\fe_lag_all_inc_subj_obj.tex", b(2) se replace booktabs alignment(D{.}{.}{3})
	
	
* Error correction model: lagged DV	
clonevar pidstr = partyid_str10 // due to charater limits

foreach var of varlist polint10 partyid01 pidstr {
	
	// exogenous
	xtdpdsys `var' hhinc_dec_pp_sqrt10 age18 unemployed nlf edu_med edu_high, twostep vce(robust) lags(2) maxldep(2) maxlags(2) artests(2)
	estat abond
	eststo ec_exo_`var'_inc_pp_s
	
	// predetermined	
	xtdpdsys `var' age18 unemployed nlf edu_med edu_high, twostep vce(robust) lags(2) maxldep(2) maxlags(2) artests(2) pre(hhinc_dec_pp_sqrt10)
	estat abond
	eststo ec_pre_`var'_inc_pp_s

	
	// endogeneous
	xtdpdsys `var' age18 unemployed nlf edu_med edu_high, twostep vce(robust) lags(2) maxldep(2) maxlags(2) artests(2) end(hhinc_dec_pp_sqrt10)
	estat abond
	eststo ec_end_`var'_inc_pp_s

}

esttab ec_exo_polint10_inc_pp_s ec_pre_polint10_inc_pp_s ec_end_polint10_inc_pp_s ///
	ec_exo_partyid01_inc_pp_s ec_pre_partyid01_inc_pp_s ec_end_partyid01_inc_pp_s ///
	ec_exo_pidstr_inc_pp_s ec_pre_pidstr_inc_pp_s ec_end_pidstr_inc_pp_s ///
	using "$OUT\Tables\SOEP\ec_all_hhinc_dec_pp_sqrt.rtf", b(3) scalar(arm1 arm2) se replace
	
esttab ec_exo_polint10_inc_pp_s ec_pre_polint10_inc_pp_s ec_end_polint10_inc_pp_s ///
	ec_exo_partyid01_inc_pp_s ec_pre_partyid01_inc_pp_s ec_end_partyid01_inc_pp_s ///
	ec_exo_pidstr_inc_pp_s ec_pre_pidstr_inc_pp_s ec_end_pidstr_inc_pp_s ///
	using "$OUT\Tables\SOEP\ec_all_hhinc_dec_pp_sqrt.tex", b(3) scalar("N N" "arm1 ABT(1)" "arm2 ABT(1)") se replace label nonumbers booktabs alignment(D{.}{.}{3}) ///
	varlabels ///
				(edu_med "Edu: medium" ///
				edu_high "Edu: high" ///
				age18 "Age" ///
				unemployed "Unemployed" ///
				nlf "Not in Labor Force" ///
				hhinc "Income" ///
				hhinc_dec_pp_sqrt10 "Income (dec.)" ///
				hhinc_sat "Sat. Income" ///
				_cons "Constant" ///
				L.partyid01 "Party ID\textsubscript{t-1}" ///
				L2.partyid01 "Party ID\textsubscript{t-2}" ///
				L.polint10 "Pol. Interest\textsubscript{t-1}" ///
				L2.polint10 "Pol. Interest\textsubscript{t-2}" ///
				L.pidstr "PID Strength\textsubscript{t-1}" ///
				L2.pidstr "PID Strength\textsubscript{t-2}")


*

